# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=cargo-leptos
pkgver=0.2.17
pkgrel=0
pkgdesc="Build tool for Leptos"
url="https://leptos.dev"
arch="x86_64 aarch64" # dart-sass
license="MIT"
makedepends="cargo-auditable"
depends="
	binaryen
	cargo
	cargo-generate
	dart-sass
"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/leptos-rs/cargo-leptos/archive/refs/tags/v$pkgver.tar.gz
"
options="net"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen --features no_downloads
}

check() {
	cargo test --frozen --features no_downloads
}

package() {
	install -Dm 755 target/release/cargo-leptos "$pkgdir"/usr/bin/cargo-leptos

	install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}

sha512sums="
fddce550ee3c903d04f2cb7fa01b370c8991e565f4d1c0a8a6af4019948dcff9c0b698af2176a4502f1026bf6a8e697c6951b68d5ed0ef9f37f9da959cae0f85  cargo-leptos-0.2.17.tar.gz
"
